package de.wbh.gwt.form.layouter.gwt;

import com.google.gwt.activity.shared.ActivityManager;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.ui.RootLayoutPanel;

import de.wbh.gwt.form.layouter.gwt.di.AppGinjector;
import de.wbh.gwt.form.layouter.shared.SkeletonView;

public class WebFormLayouter implements EntryPoint {

	@Override
	public void onModuleLoad() {

		System.out.println("SATRT APP");

		AppGinjector ginjector = GWT.create(AppGinjector.class);

		ginjector.getSkeletonPresenter();

		SkeletonView skeletonView = ginjector.getMainView();

		ActivityManager deck1ContentActivityManager = ginjector.getDeck1ContentAreaActivityManager();
		deck1ContentActivityManager.setDisplay(skeletonView.getDeck1Center());

		ActivityManager deck2LeftAreaActivityManager = ginjector.getDeck2LeftAreaActivityManager();
		deck2LeftAreaActivityManager.setDisplay(skeletonView.getDeck2Left());

		ActivityManager deck2RightAreaActivityManager = ginjector.getDeck2RightAreaActivityManager();
		deck2RightAreaActivityManager.setDisplay(skeletonView.getDeck2Right());

		RootLayoutPanel.get().add(skeletonView);

		ginjector.getPlaceHistoryHandler().handleCurrentHistory();

	}
}
